90 IV ADDITIONAL PROPERTIES OF THE REAL LINE be such that for y e A n E(x; r\ \f(y) -/(x)| < e. Let C = A n B(x; r), D = A — C; if x' e E - A and d(x, x') ^ r/4, we have, for each y e D, d(x'9 y) ^ d(x, y) - d(x, x') > 3r/4, hence yeD on the other hand, f(x) d(x'9 x) < 2d(;c', x) ^ r/2, and therefore inf (/GO 4*', j;)) yeA yeC But, as /(x) - £ e C, and inf d(jc', y) = rf(x', A), we have ye€ (f(x) - e) dfjc', A) < inf (f(y) d(x', y)) ^ (/(x) + e) d(x'9 A) which proves that \g(xr) —f(x)\ ^ fi for x' e E — A and d(x9 x') < r/4; on the other hand, if x' e A and d(x, *') < r/4, |^(xr) -/(x)| = \f(x') -f(x)\ ^ e, and this ends the proof. (4.5.2) Let A, B be two nonempty closed sets in a metric space E, such that A n B = 0. Then there is a continuous function f defined in E, with values in [0, 1], such that f(x) = I in A andf(x) = 0 in B. Apply (4.5.1) to the mapping of A u B in R, equal to 0 in B and to 1 in A, which is continuous in A u B. PROBLEMS 1. In a metric space E, let (Fn) be a sequence of closed sets, A the union of the Fn; if x $ A, show that there exists a bounded continuous function /> 0 defined in E, such that /(jc) = 0 and f(y) > 0 for each y e A (use (4.5.2) and (7.2.1)). 2. (a) Let E be a metric space such that every bounded set in E is relatively compact; show that E is locally compact and separable (use (3.16.2)). (b) Conversely, let E be a locally compact, noncompact separable metric space, d the distance on E; let (Un) be a sequence of relatively compact open subsets of E such that On ^ Un+l and E is the union of the sequence (Un) (3.18.3). Show that there exists a continuous real-valued function / in E such that f(x) ^ n for x e Ort and f(x) ^ n for x e E - U« (use (4.5.2)); the distance d'(x, y) = d(x, y) + \f(x) -f(y)\ is then topologi- cally equivalent to d, and for d', any bounded set is relatively compact. Let r = d(x, A); for